import { createRequest } from '/@/api/service';
const module = 'ib/base/v1/AppSysOrganApi/';

/**
 * @function 查询组织
 * @param data
 * @param header
 * @returns {Promise}
 */
function SYS_ORGAN_QUERY_APP(
  data: AppSysOrganApi.SysOrganQueryAppReq,
  header: object = {},
): Promise<AppSysOrganApi.SysOrganQueryAppResp> {
  return createRequest(`${process.env.APP_API_URL}${module}sysOrganQueryApp`, data, header, 'POST');
}

/**
 * @function 开放查询组织
 * @param data
 * @param header
 * @returns {Promise}
 */
function OPEN_SYS_ORGAN_QUERY_APP(
  data: AppSysOrganApi.SysOrganQueryAppReq,
  header: object = {},
): Promise<AppSysOrganApi.SysOrganQueryAppResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}open/sysOrganQueryApp`,
    data,
    header,
    'POST',
  );
}

/**
 * @function 移动端-通讯录组织查询
 * @param data
 * @param header
 * @returns {Promise}
 */
function ADDRESS_BOOK_SYS_ORGAN_QUERY_APP(
  data: AppSysOrganApi.AddressBookSysOrganQueryAppReq,
  header: object = {},
): Promise<AppSysOrganApi.AddressBookSysOrganQueryAppResp> {
  return createRequest(
    `${process.env.APP_API_URL}${module}addressBookSysOrganQueryApp`,
    data,
    header,
    'POST',
  );
}

export { SYS_ORGAN_QUERY_APP, OPEN_SYS_ORGAN_QUERY_APP, ADDRESS_BOOK_SYS_ORGAN_QUERY_APP };
